//custom includes
#include "Window.h"
#include "InputHandler.h"
#include "SubSystemManager.h"
#include "debug.h"

int main()
{
	printInfoLog<int>(2);
	InputInterface* inputInterface = new InputInterface();
	Window* window = new Window();
	SubSystemManager* subSystemManager = new SubSystemManager();

	subSystemManager->addSubsystem(new TestSubSystem);
	subSystemManager->addSubsystem(new ParticleSubSystem);
	
	if(!window->init())
	{
		printf("problem with window init\n");
	}

	subSystemManager->onInit();

	while(window->isRunning())
	{
		//update section
		inputInterface->update();
		subSystemManager->onUpdate();
		window->updateWindow();
		window->updateTitle<double>(window->deltaTime());
		//end update section
		//draw section
		window->clearWindow();
		subSystemManager->onDraw();

		window->swapBuffers();
		//end draw section
		
		window->setRuning(inputInterface->isExitButtonReleased());

	}

	delete window;
	return 0;
}